package encrypt
import (
	
	"encoding/base64"
	openssl "github.com/forgoer/openssl"
)

//密码强度必须为字⺟⼤⼩写+数字+符号，9位以上
func DecryptParam(pwd string,keyStr string) (string, error) {
	key := []byte(keyStr)
	iv := []byte(keyStr)


	cipherBytes, err1 := base64.StdEncoding.DecodeString(pwd)
	if err1 != nil {
		return "", err1
	}
	decryptBytes, err2 := openssl.AesCBCDecrypt(cipherBytes, key, iv, openssl.ZEROS_PADDING)
	if err2 != nil {
		return "", err2
	}
	return string(decryptBytes), nil

}